﻿
using hcache;
using hlog;
using hq;
using MongoDB.Bson;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
namespace hconnect {
    public class MongoLogTask : ZtTask {

        IMServer mServer = GuidangFactray.getDal<IMServer>();

        long emplyTime = DateTime.Now.Ticks;
        protected override bool init() {
            time = 1000;
            return true;
        }

        public override void excute() {
            Dictionary<string ,List<BaseMongoLog>> dict = GuidangCache.getAllMongoData();
            foreach( var t in dict ) {
                mServer.InsertBatch(t.Value);
            }

            mServer.InsertBatch("status" ,StatusCache.getDef());

        }



    }
}
     